<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
if($_RQ['op']=='list'){
	$pindex = max(1, intval($_RQ['page']));
	$psize = 15;
	$params=array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']);
    $orderby='createtime desc';
	$total='';
	$return['list']=pdo_getslice('jy_merch_msglog',$params,array($pindex,$psize),$total,$fields,'',$orderby);	
	foreach($return['list'] as &$v){
		$v['createtime']=date('Y-m-d',$v['createtime']);
		$v['typetitle']=$this->msglog_type[$v['type']];
		if($v['type']==3){
			$merch=pdo_get('jy_merch_user',array('uniacid'=>$_SESSION['uniacid'],'id'=>$v['merchid']));
			$v['typetitle']=$merch['merchname'];
			$v['image']=$merch['logo'];
		}elseif($v['type']==0){
			$v['image']='../core/resource/images/diy/icon/icon-2.png';
		}elseif($v['type']==1){
			$v['image']='../core/resource/images/diy/icon/icon_goods.png';
		}elseif($v['type']==2){
			$v['image']='../core/resource/images/diy/icon/icon_redbag.png';
		}
	}
	exi($return);
}
